home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / comm / fido / fz104.lha / rexx / SetDSize.rexx < prev    next >
OS/2 REXX Batch file  |  1992-06-01  |  824b  |  46 lines

  1. /*
  2.  *
  3.  *        Set Dupe-Table Size for all areas
  4.  *
  5.  *
  6.  *        Usage: rx SetDupSize <infile> <outfile>
  7.  *
  8.  *        e.g.   rx SetDupSize dh1:Foozle.area ram:Foozle.areas
  9.  *
  10.  */
  11.  
  12. dupsize = 1        /* DupeTableSize: 0=0; 1=200; 2=500; 3=1000 */
  13.  
  14. parse arg infile outfile
  15.  
  16. if ~open(in, infile, R) then do
  17.     say "Couldn't open" infile "!"
  18.     exit 20
  19.     end
  20.  
  21. if ~open(out, compress(outfile), W) then do
  22.     say "Couldn't open" outfile "!"
  23.     call close in
  24.     exit 20
  25.     end
  26.  
  27. do forever
  28.     area = readch(in, 728)
  29.     if length(area) < 728 then leave
  30.     else if left(area, 1) ~= "00"x then area = overlay(d2c(dupsize), area, 201)
  31.      else leave
  32.     call writech out, area
  33. end
  34.  
  35. call writech out, area
  36. do forever
  37.     area = readch(in, 1000)
  38.     call writech out, area
  39.     if length(area) < 1000 then leave
  40. end
  41.  
  42. call close out
  43. call close in
  44. exit
  45.  
  46.